package com.easyssh.framework.entity;

import javax.persistence.MappedSuperclass;
import javax.persistence.Transient;

@MappedSuperclass
public abstract class AbstractEntity extends NullEntity {
	private static final long serialVersionUID = 1L;
	private String changeLog;

	@Transient
	public boolean isNew() {
		return getId() == null || -1 == getId().intValue();
	}

	@Transient
	public String getChangeLog() {
		return changeLog;
	}

	public void setChangeLog(String changeLog) {
		this.changeLog = changeLog;
	}

	public String toString() {
		return (new StringBuilder(String.valueOf(super.getClass().getName())))
				.append("#").append(getId()).toString();
	}

}
